<template>
	<view>
		<u-button @click="modifyVuex">修改变量</u-button>
		<my-list v-if="vuex_user.role=='doctor'"></my-list>
		<my-record v-if="vuex_user.role=='user'"></my-record>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			modifyVuex() {
				let rolename = this.vuex_user.role=='user'?'doctor':'user'
				let rolename1 = this.vuex_user.role=='user'?'用户':'医生'
				let path = this.vuex_user.role=='user'?'static/icon/test.png':'static/icon/test1.png';
				let patha = this.vuex_user.role=='user'?'static/icon/test_active.png':'static/icon/test1_active.png';
				this.$u.vuex('vuex_user.role', rolename);
				uni.setTabBarItem({
				  index: 1,
				  text: rolename1,
				  iconPath:path,
				  selectedIconPath:patha
				})
			}
		}
	}
</script>

<style>

</style>
